<script>
export default {
  name: "login"
}
</script>
<script setup>
import { useRouter, useRoute } from 'vue-router'
import {useLogin} from "@/stores/pinia/login.js";

const router = useRouter()
const route = useRoute()
const userStore = useLogin()

const handleLogin = async () => {
  // 模拟登录接口调用
  await userStore.login({ username: 'test', password: '123' })

  // 登录成功后，判断是否有 redirect 参数
  const redirectPath = route.query.redirect || '/'
  router.push(redirectPath) // 跳回原页面或首页
}
</script>

<template>
  <div class="login"></div>
</template>

<style scoped lang="less">

</style>
